In [2]:
from sympy import init_session
init_session()
In [3]:
p,mu,x,k = symbols('p,mu,x,k')
In [4]:
f = p * mu * ( ( (mu * x)** (k -2)) / factorial(k - 2) ) * exp(-mu*x) + (1 -p) * mu * ( ( (mu *x )** (k -1)) / factorial(k -1) ) * exp(-mu*x)
In [5]:
f
Out[5]:
In [6]:
F = integrate(f,x)
In [12]:
F
Out[12]:
Check if F is correct by deriving F, then subtract that from the original function
In [7]:
diff(F,x)
Out[7]:
In [8]:
eq = diff(F,x) - f
simplify(eq)t
Out[8]:
In [9]:
simplify(F)
Out[9]:
In [ ]: